package design_mode.装饰者.模版;

public class Decorator extends AbstractComponent {
    protected AbstractComponent component;

    public void setComponent(AbstractComponent component) {
        this.component = component;
    }

    @Override
    public void operation() {
        // 实际调用component的operation方法
        if (component != null) {
            component.operation();
        }
    }
}
